PATH
WebObjects 4.5 Documentation >
Post Install Guide
Troubleshooting WebObjects 4 Template Parsing
The WebObjects template parser parses the HTML that is to be included in a response. In WebObjects 4, the template parser preserves all of the static HTML that you provide in a component's template. Previously, the parser recognized many HTML tags and performed special processing based on the type of tag. The WebObjects 4 template parser ignores all tags besides
<WEBOBJECT>
and HTML comment tags.
The new parser has several advantages:
-
It solves the problem many have encountered where WebObjects attempts to "fix" your HTML. For example, it previously was difficult to split a container element, such as a form, across two components because WebObjects would insert a closing tag for you.
-
It improves your application's performance because it tends to treat larger parts of a file as a single chunk than the previous parser did.
-
It allows you to suppress the copying of comments to the outgoing response. This speeds up response generation and shortens download times.
A WebObjects application may unknowingly depend upon the previous behavior of the template parser. For this reason, a compatibility flag is available on WOApplication to revert to the previous behavior.
Usually when WebObjects 4 template parsing produces an error, it is because you have included a WebObjects dynamic form element inside of a static HTML
FORM
element. Change the
FORM
element to a WOForm, and your component should operate normally again. An error may also arise if your HTML pages contain
BODY
or
IMG
tags with
src
parameters containing relative pathnames (absolute pathnames aren't a problem). Change the affected tags to WOBody and WOImage, respectively.
If you want, you can go back to the previous parser by implementing this method in your application class (shown in Java and WebScript):
public boolean requiresWOF35TemplateParser() {
return true;
}
- requiresWOF35TemplateParser {
return YES;
}
If you use the WebObjects 4 template parser, you might want to suppress the inclusion of HTML comments. Use WOApplication's
setIncludeCommentsInResponses:
method, or use the
WOIncludeCommentsInResponses
option described in "Starting Up Applications From the Command Line" in
Deploying WebObjects Applications
.
© 1999 Apple Computer, Inc. – (Last Updated 19 Oct 99)